import request from '../utils/request'  // 导入的是直接可调用的函数

export default{
  getAllExhibition(){
  return request({
      url:'/exhibition',
      method:'get'
    })
  },
  getExhibitionById(id){
    return request({
      url:'/exhibition/'+id,
      method:'get'
    })
  },
  getExhibitionTicket(date){
    return request({
      url:'/exhibition/getExhibitionByDate',
      method:'get',
      data:{
        startDate:date
      }
    })
  },
  getExhitionTicketOrder(name,startDate){
    return request({
      url:'/exhibition/getExhibitionByName/'+name,
      method:'get',
      data:{
        startDate:startDate
      }
    })
  },
  submitOrder(userOrder){
    return request({
      url:'/exhibition/submitExhibitionReservation',
      method:'post',
      data:{
        userOrder,
      }
    })
  },
  //支付展览预约
  payExhibitionOrder(id){
    return request({
      url:'/exhibition/payOrder',
      method:'post',
      data:{
        orderId:id
      }
    })
  },
  //进行展览点赞
  likeExhibition(exhibitionId){
    return request({
      url:'/exhibition/likeExhibition/'+exhibitionId,
      method:'post'
    })
  },
  //进行点赞取消操作
  cancelLike(exhibitionId){
    return request({
      url:'/exhibition/cancelLikeExhibition/'+exhibitionId,
      method:'post'
    })
  },
  //判断用户是否点赞
  isLike(exhibitionId){
    return request({
      url:'/exhibition/isLikeExhibition/'+exhibitionId,
      method:'get'
    })
  },
  //根据名称获取id
  getExhibitionIdByName(name){
    return request({
      url:'/exhibition/getExhibitionIdByName/'+name,
      method:'get'
    })
  },
  //获取所有的展览订单信息
  getMyExhibitionReservation(){
    return request({
      url:'/exhibition/getMyExhibitionReservation',
      method:'get'
    })
  },
  //获取展览某个订单详情
  getExhibitionOrderDetail(id,exhibitionName){
    return request({
      url:'/exhibition/userOrder/'+id,
      method:'get',
      data:{
        exhibitionName:exhibitionName
      }
    })
  }
}